const path = require('path')
const { VueLoaderPlugin } = require('vue-loader'); //新版vue-loader必须加入
module.exports = {
    entry:path.join(__dirname,'./src/main.js'),
    output:{
        path:path.join(__dirname,'dist'),
        filename:'bundle.js'
    },
     devServer:{
    //     contentBase:path.join(__dirname,'dist'),
         port:'8000',
         host:'localhost'
     },
    mode:"development",
    module:{
        rules:[
            {test:/\.css$/,use:['style-loader','css-loader']},
            {test:/\.(jpg|png|gif|bmp|jpeg)$/,use:[{loader:'file-loader',options:{esModule:false}}]}, //处理src图片地址的时候，新版的file-loader需要设置options:{exModule:false}，否则src地址不出来。
            {test:/\.vue$/,use:'vue-loader',exclude:/node_modules/},
            { test: /\.js$/, use: 'babel-loader', exclude: /node_modules/},
            {test:/\.scss$/,use:['style-loader','css-loader','sass-loader']},//配置处理.scss文件的第三方loader规则
            {test:/\.(ttf|eot|woff|woff2|svg)/,use:'file-loader'}
        ]
    },
    plugins:[
        new VueLoaderPlugin()//新版vue-loader必须加入
   //     new webpack.ProvidePlugin({
   //         ​ $:'jquery',
   //         ​ jQuery:'jquery'
   //         ​ })
    ]
}
